package org.ksystem.practise.thread.task;

public class RunnableTask1 implements Runnable {

    private int count = 0;

    public RunnableTask1(int count) {
        this.count = count;
    }

    public void run() {

        Long timeBegin = System.currentTimeMillis();
        System.out.println("THREAD BEGIN:" + timeBegin);

        for (int i = 0; i < count; i++) {
            System.out.println(Thread.currentThread().getName() + " out:" + i);
        }

        Long timeEnd = System.currentTimeMillis();
        System.out.println("THREAD END:" + timeEnd + " TIME SPEND:" + (timeEnd - timeBegin) / 1000);
    }
}
